package org.chench.test.gatewayzuul.config;

import org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class BeanRegister {
    // 设置自定义路由映射规则，将hiservice-v1这样的服务名映射为路径v1/hiservice
    // 这样可以通过路径http://localhost:8766/v1/hiservice/hi/chench访问到服务hiservice-v1
//    @Bean
//    public PatternServiceRouteMapper serviceRouteMapper() {
//        return new PatternServiceRouteMapper("(?<name>^.+)-(?<version>v.+$)","${version}/${name}");
//    }
}
